from osv import osv, fields
import pooler

from tools import config
from tools.translate import _

class res_currency(osv.osv):
    _inherit='res.currency'
    _name="res.currency"
    
   
#    def name_search(self, cr, uid, name, args=[], operator='ilike', context=None, limit=80):
##        fo=open("/home/openerp/Desktop/a.txt","w")
##        fo.write(str(context))
##        fo.write("A")
##        fo.close()
#        args2 = args[:]
#        if name:
#            args += [('name', operator, name)]
#            args2 += [('code', operator, name)]
#        ids = self.search(cr, uid, args, limit=limit)
#        ids += self.search(cr, uid, args2, limit=limit)
#        default1=self._get_default_id(cr,uid)
#        if context.get('project_curr',False):
#            project_code=context.get('project_curr',False)
#            if isinstance(project_code,int):                
#                project_code=self.pool.get('account.analytic.account').read(cr,uid,[int(project_code)],['code'])[0]['code']
#            ids= self.search(cr, uid, [('code', operator,project_code+"-"+name.upper().strip())], limit=limit)
#            #id_usd= self.search(cr, uid, [('code','=','VND')], limit=limit)
#            if default1 and default1 not in ids and not (len(ids)==1 and name): 
#                ids.append(default1) 
##        elif context.get('project_view',False):
##            project_code=context.get('project_curr',False)
##            cr.execute("Select id from res_currency where code like 'P%-%-%")
##            ids=cr.fetchall()
##            new_list=[]
##            for id in ids:
##                new_list.append(id)
##            #ids= self.search(cr, uid, [('code', operator,project_code+"-"+name.upper().strip())], limit=limit)
##            
##            if default and default1 not in new_list: 
##                new_list.append(default1) 
#        res = self.name_get(cr, uid, ids, context)        
#        return res
res_currency()

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
